  //  echo 警告数据
let activeAlert = []
  //  echo alert-log
let alertLog = []

  //  当前警报 是否在activeAlert 里
let isInActiveAlert = function (alertId) {
  for (let i = 0; i < activeAlert.length; i++) {
    if (activeAlert[i].alertId === alertId) {
      return true
    }
  }
  return false
}

let getAlertText = function (alertId) {
  switch (alertId) {
    case 230:
      return '230 Depth below Keel Alarm'
    case 201101:
      return '101 TX Volt Error1'
    case 201111:
      return '111 TX Volt Error2'
    case 201102:
      return '102 RX Volt Error1'
    case 201112:
      return '112 RX Volt Error2'
    case 201103:
      return '103 TCVR High Temperature 1'
    case 201113:
      return '103 TCVR High Temperature 2'
    case 201301:
      return '301 DISP COM Error'
    case 201302:
      return '302 TCVR COM Error'
    case 201001:
      return '001 Bottom Lost'
    case 201303:
      return '303 UTC Timeout'
    case 201104:
      return '104 Fan0 Speed Error1'
    case 201114:
      return '114 Fan0 Speed Error2'
    case 201950:
      return '950 BAM COM Error'
    default:
      return 'Disp the Main Menu'
  }
}
let getAlertIcon = function (alertId) {
  switch (alertId) {
    case 230:
      return '../assets/AlarmIcon.png'
    case 201101:
      return ''
    case 201111:
      return ''
    case 201102:
      return ''
    case 201112:
      return ''
    case 201103:
      return ''
    case 201113:
      return ''
    case 201301:
      return ''
    case 201302:
      return ''
    case 201001:
      return ''
    case 201303:
      return ''
    case 201104:
      return ''
    case 201114:
      return ''
    case 201950:
      return ''
    default:
      return '../assets/menuIcon.png'
  }
}
export default {
  activeAlert,
  alertLog,
  isInActiveAlert,
  getAlertText,
  getAlertIcon
}
